<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


</head>
<body>
    // HTML部分:
    <table id="infoTable">
      <thead>
        <tr>
          <th>
            <input type="checkbox" id="selectAll" onclick="toggleSelectAll()" />
          </th>
          <th>姓名</th>
          <th>任免表</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><input type="checkbox" onclick="printDetails(this)" /></td>
          <td>张三</td>
          <td>详情1</td>
        </tr>
        <tr>
          <td><input type="checkbox" onclick="printDetails(this)" /></td>
          <td>李四</td>
          <td>详情2</td>
        </tr>
        <!-- 其他行 -->
      </tbody>
    </table>
    <script>// JavaScript部分:
        function toggleSelectAll() {
          var checkboxes = document.getElementsByTagName("input");
          var selectAllCheckbox = document.getElementById("selectAll");
        
          for (var i = 0; i < checkboxes.length; i++) {
            if (checkboxes[i].type == "checkbox") {
              checkboxes[i].checked = selectAllCheckbox.checked;
            }
          }
        }
        
        function printDetails(checkbox) {
          if (checkbox.checked) {
            var name = checkbox.parentNode.parentNode.getElementsByTagName("td")[1].innerText;
            var details = checkbox.parentNode.parentNode.getElementsByTagName("td")[2].innerText;
            console.log(name + " 的详情： " + details);
          }
        }</script>
</body>
</html>